/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
  <file> uls_print.h </file>
  <brief>
    Vararg routines for printing output to files.
    This file is part of ULS, Unified Lexical Scheme.
  </brief>
  <author>
    Stanley J. Hong <babel96@gmail.com>, 2011.
  </author>
*/

#ifndef _ULS_PRINT_H_
#define _ULS_PRINT_H_

#include "uls_type.h"
#include "uls_lf_swprintf.h"

#include <stdarg.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

void uls_sysprn_open(void* data, uls_lf_puts_t proc);
void uls_sysprn_close(void);

int uls_snprintf(uls_lf_char_t *buf, int bufsiz, const uls_lf_char_t *fmt, ...);
int uls_sprintf(uls_lf_char_t *buf, const uls_lf_char_t *fmt, ...);

int uls_vprint(const uls_lf_char_t* fmt, va_list args);
int uls_print(const uls_lf_char_t* fmt, ...);
int uls_vfprintf(FILE* fp, const uls_lf_char_t *fmt, va_list args);
int uls_fprintf(FILE* fp, const uls_lf_char_t *fmt, ...);
int uls_printf(const uls_lf_char_t *fmt, ...);

int uls_wprint(const uls_lf_word_t* fmt, ...);
int uls_snvwprintf(uls_lf_word_t* wbuf, int wbuf_siz, const uls_lf_word_t *wfmt, va_list args);
int uls_snwprintf(uls_lf_word_t* wbuf, int wbuf_siz, const uls_lf_word_t *wfmt, ...);
int uls_swprintf(uls_lf_word_t * wbuf, const uls_lf_word_t *wfmt, ...);
int uls_fwprintf(FILE* fp, const uls_lf_word_t *wfmt, ...);
int uls_wprintf(const uls_lf_word_t *wfmt, ...);

#ifdef __cplusplus
}
#endif

#endif
